package com.ibbi.admin.client.front.category.handlers;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;
import com.ibbi.admin.client.rpc.obj.Category;

import corelib.client.ui.widget.Size;
import corelib.client.ui.widget.WidgetListener;
import corelib.client.ui.widget.WindowHandle;
import corelib.client.ui.widget.button.IsButton;
import corelib.client.ui.widget.dialog.SimpleDialogHandler;
import corelib.client.ui.widget.form.SelectField;
import corelib.client.ui.widget.form.TextAreaField;
import corelib.client.ui.widget.form.TextField;
import corelib.client.ui.widget.layout.RelativeColumn;

public class AddCategoryHandler extends SimpleDialogHandler {
	
	private Category category;
	private TextField     nameField = new TextField();
	private TextAreaField descField = new TextAreaField();
	private SelectField   typeField = new SelectField();
	
	@Override
	public String getHeading() {
		return "增加栏目";
	}

	@Override
	public Size getSize() {
		return new Size(800, 600);
	}

	@Override
	public Widget getContentPanel() {
		FlowPanel panel = new FlowPanel();
		panel.getElement().getStyle().setPadding(15, Unit.PX);
		
		RelativeColumn column = new RelativeColumn();
		
		panel.add(column.getPanel());
		return panel;
	}

	@Override
	public IsButton[] getButtons() {
		return new IsButton[]{
			new IsButton("确定", new WidgetListener(){
				@Override
				public void valueUpdated(Widget widget) {
					
				}
			})	
		};
	}

	@Override
	public void onClosing(WindowHandle windowHandle) {
		windowHandle.close();
	}

}
